<template>
  <view>
    <zxz-uni-data-select
        v-model="value"
        :localdata="range"
        @change="change"
        :clear="false"
        filterable
    ></zxz-uni-data-select>
  </view>
</template>

<script>
import {listDept} from "@/api/maintain/maintainList";

export default {
  name: 'selectCorporation',
  computed: {},
  watch: {},
  data() {
    return {
      range: [],
      value: ''
    };
  },
  created() {
  },
  mounted() {
    this.getCompanyOrigin()
  },
  methods: {
    getCompanyOrigin() {
      listDept({
        deptType: "2", //组织类型（1部门 2公司）
        regionId: null, //所在城市（省市区id）
      }).then((res) => {

        this.range = res.data.map(item => {
          return {
            value: item.deptId,   // 选项id
            text: item.deptName
          }
        });
      });
    },

    change(val) {
      this.$emit('change',val)
    },

    reset(){
      this.value = ''
    }
  },
};
</script>

<style scoped lang=""></style>


